package com.mars.diancan.pojo;

import lombok.*;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 商品类目表实体类
 * 数据表：wx_product_category
 * @Entity：表示数据库与实体类的映射
 * @DynamicUpdate：表示动态更新实体类中的字段，当遇到属性为null的，不更新该属性
 *
 * @author MARS
 * @date 2018/6/20
 */
@Table(name = "wx_product_category")
@Entity
@DynamicUpdate
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProductCategory {
    /** 类目id. @Id:表示主键  @GeneratedValue 表示自增id */
    @Id
    @GeneratedValue
    private Integer categoryId;

    /** 类目名字. */
    private String categoryName;

    /** 类目编号. */
    private Integer categoryType;

    private Date createTime = new Date();

    private Date updateTime = new Date();

    @Override
    public String toString() {
        return "ProductCategory{" +
                "categoryId=" + categoryId +
                ", categoryName='" + categoryName + '\'' +
                ", categoryType=" + categoryType +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
